package com.lantosec.hmrp.modules.system.enumeration;

/**
 * 报表字段数据类型
 */
public enum ReportFieldDataTypeEnum {
    //数字 number，字符 char，日期 date
    NUMBER("NUMBER","数字"),
    CHAR("CHAR", "字符"),
    DATE("DATE", "日期");

    private String type;
    private String name;

    private ReportFieldDataTypeEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static ReportFieldDataTypeEnum getByType(String type) {
        for (ReportFieldDataTypeEnum item : ReportFieldDataTypeEnum.values()) {
            if (item.getType().equals(type)) {
                return item;
            }
        }
        return ReportFieldDataTypeEnum.CHAR;
    }
}
